Skip to content

Implement easier change of bank account#94019

Merged
robertjchen merged 65 commits into
Expensify:mainfrom
callstack-internal:feat/79607-easier-change-of-bank-account
Jul 20, 2026
Merged

Implement easier change of bank account#94019
robertjchen merged 65 commits into
Expensify:mainfrom
callstack-internal:feat/79607-easier-change-of-bank-account

Conversation

@VickyStash

@VickyStash VickyStash commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Workspace admins can now switch their reimbursement bank account directly from the connected/verified bank account screen, without disconnecting the current account first.

A new "Change bank account" option is added to the connected verified bank account screen. When pressed:

  • If the workspace has other eligible existing business bank accounts , the user is taken to the existing-account picker. The currently connected account is hidden from this list.
  • If there are no other eligible accounts, the user goes straight into the flow to set up a brand-new bank account.

Fixed Issues

$ #79607
PROPOSAL: N/A

Tests

  • Verify that no errors appear in the JS console

Setup: a workspace (USD) where you're an admin, and at least one business bank account already connected to your account.

1.Workflows → Payments -> Add bank account.
2. Select the account that is already set up.

Change BA → Add BA (new account) → links to workspace

  1. Workflows → Payments -> Tap on BA
  2. You will see Change bank account row. Tap on it.
  3. Tap Log into your bank account, proceed with the Plaid BA setup flow.
  4. Verify: after finishing, the newly added account is linked to Workflows → Payments for that workspace.

Change BA → pick an existing account → links to workspace

  1. Workflows → Payments -> Tap on BA
  2. You will see Change bank account row. Tap on it.
  3. Select another BA
  4. Verify selected account is now shown as the bank account for Workflows → Payments

Add partially set up bank account (add bank account, but don't provide personal info).

Change BA → pick an partially setup account

  1. Workflows → Payments -> Tap on BA
  2. You will see Change bank account row. Tap on it.
  3. Select another partially setup BA
  4. Verify selected account is now shown as the bank account for Workflows → Payments
  5. Verify you see Almost done page.
  6. Close the modal.
  7. Tap on BA.
  8. See you pushed to Almost done page with Change bank account row.
  9. Change the BA to set up BA and verify it works.

Offline tests

Same, as in Tests section

QA Steps

// TODO: These must be filled out, or the issue title must include "[No QA]."

  • Verify that no errors appear in the JS console

Same, as in Tests section

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
android_pt1.mp4
android_pt2.mp4
Android: mWeb Chrome
android_web_pt1.mp4
android_web_pt2.mp4
iOS: Native
ios_pt1.mov
ios_pt2.mov
iOS: mWeb Safari
ios_web_pt1.mov
ios_web_pt2.mov
MacOS: Chrome / Safari
web_pt1.mp4
web_pt2.mp4

koko57 and others added 25 commits February 2, 2026 11:15
…llstack-internal/Expensify-App into feat/79607-easier-change-of-bank-account
…k-internal/Expensify-App into feat/79607-easier-change-of-bank-account
# Conflicts:
#	src/pages/workspace/ConnectExistingBusinessBankAccountPage.tsx
@melvin-bot

melvin-bot Bot commented Jun 19, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

# Conflicts:
#	src/libs/actions/ReimbursementAccount/index.ts
#	src/pages/ReimbursementAccount/ConnectedVerifiedBankAccount.tsx
#	src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx
#	src/pages/workspace/ConnectExistingBusinessBankAccountPage.tsx
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/index.ts 94.81% <ø> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/hooks/useChangeBankAccount.ts 100.00% <100.00%> (ø)
src/libs/ExportOnyxState/common.ts 80.35% <ø> (ø)
src/libs/WorkflowUtils.ts 90.83% <100.00%> (+0.03%) ⬆️
src/libs/actions/Policy/Policy.ts 70.00% <100.00%> (-0.05%) ⬇️
src/selectors/ReimbursementAccount.ts 100.00% <100.00%> (ø)
src/ROUTES.ts 21.64% <85.71%> (+0.62%) ⬆️
...rc/libs/actions/ReimbursementAccount/navigation.ts 0.00% <0.00%> (ø)
src/libs/mapCurrencyToCountry.ts 0.00% <0.00%> (ø)
... and 8 more
... and 151 files with indirect coverage changes

@VickyStash

Copy link
Copy Markdown
Contributor Author

UPD: still trying to correct the second issue.
There is one issue on the new logic side, but it also looks like there is an existing issue in the same flow. Ex: when I login from account B I see one payment account, if I clear cache and reset data I see another account:

Monosnap.screencast.2026-07-15.18-07-41.mp4

I'm figuring out what goes wrong

@VickyStash

Copy link
Copy Markdown
Contributor Author

I've fixed this: #94019 (comment)
But there is separate existing issue (I've prepared recordings from staging):

  1. Login to account A and invite account B to workspace as admin.
  2. As user A link bank account 1 to workspace -> workflows
  3. Login to account B and set another BA account in the workspace -> workflows
  4. Get back to user A.
    On the workspace -> workflows you see user B BA set, but if you click on it you see another BA on all set page.

Video:

bug_staging.mp4

This happens cause policy has one account set, and user's reimbursementAccount has another one:
1_bug
2_bug

cc @joekaufmanexpensify

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

Hmm, interesting. In your example, if account B changes the Workspace Bank account to Bank account 2 and account A later goes back to the workflows page and taps the bank account row. Wouldn't they then see the option to link a different bank account again?

It's basically the inverse scenario of what Account B originally did to change the Workspace Bank account.

@VickyStash

Copy link
Copy Markdown
Contributor Author

Hmm, interesting. In your example, if account B changes the Workspace Bank account to Bank account 2 and account A later goes back to the workflows page and taps the bank account row. Wouldn't they then see the option to link a different bank account again?

It's basically the inverse scenario of what Account B originally did to change the Workspace Bank account.

Yes, I understand it, but on the video, I provide an example from staging to point out the inconsistency issue. Basically, after user B selects BA 2, it displays for user A on workflows -> payments, but if user A tap on it -> he sees BA1.
The inconsistency is due to policy.achAccount returns one account, and reimbursementAccount.achAccount another one.
See, workflows->payments has 0000 account, but all set displays 1111:
image

Is it expected that returned from BE data has different accounts in policy.achAccount and reimbursementAccount.achAccount. If so, the All set page then should show BA provided in policy.achAccount?

@VickyStash

Copy link
Copy Markdown
Contributor Author

cc @robertjchen wdyt about this one?

@joekaufmanexpensify

Copy link
Copy Markdown
Contributor

I agree. Seems odd to me. Discussing more here.

@robertjchen

Copy link
Copy Markdown
Contributor

Is it expected that returned from BE data has different accounts in policy.achAccount and reimbursementAccount.achAccount. If so, the All set page then should show BA provided in policy.achAccount?

Yes, it's expected that it's different. From my understanding:

  • policy.achAccount = the workspace's real, shared payment account (whatever the last admin set)
  • reimbursementAccount.achAccount = a per-user view. The backend re-maps the policy account to a copy the viewing user personally owns (because reimbursement runs under the reimburser's own bank account ID). A doesn't own B's account, so A falls back to their own.

So in this case, the display here should use policy.achAccount 🤔

@VickyStash

Copy link
Copy Markdown
Contributor Author

It was agreed to fix this existing issue in a separate PR.
@ZhenjaHorbach, can you please continue the review of this one?

@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

Will recheck soon!

@melvin-bot
melvin-bot Bot requested a review from robertjchen July 20, 2026 09:24
@ZhenjaHorbach

Copy link
Copy Markdown
Contributor

Changes look good!

@robertjchen robertjchen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@robertjchen
robertjchen merged commit 44aa54b into Expensify:main Jul 20, 2026
36 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 robertjchen has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/robertjchen in version: 9.4.41-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site changes required — draft PR created.

This PR adds a user-facing Change bank account option on the connected/verified bank account screen, letting Workspace Admins and Payments Admins switch a workspace's reimbursement bank account without disconnecting the current one first. The help site's Connect a US Business Bank Account article covered connecting and linking accounts but had no coverage of switching an already-connected account, so I documented the new flow.

Draft PR: #96539

What changed in the docs
  • Added a new task-based section, How to change the connected business bank account on a workspace, covering the WorkflowsPayments → connected bank account → Change bank account flow and its two outcomes (pick an existing eligible account, with the current one hidden; or set up a new account when none are eligible).
  • Updated the article keywords and internalScope to include the change/switch workflow.
  • Verified the UI label Change bank account against the PR copy (workspace.bankAccount.changeBankAccount in en.ts) and applied HELPSITE_NAMING_CONVENTIONS.md, HELP_AUTHORING_GUIDELINES.md, and TEMPLATE.md.

@VickyStash, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review

@jponikarchuk

jponikarchuk commented Jul 21, 2026

Copy link
Copy Markdown

Deploy Blocker #96647 was identified to be related to this PR.

@lanitochka17

Copy link
Copy Markdown

Deploy Blocker #96651 was identified to be related to this PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.41-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants